import http from "../utils/http";

// 获取商品列表
let getGoodsList = (data:UsersListParams)=>http(`goods`,'get',data);

//获取商品分类
let getCateList = (data:GoodsCateType)=>http(`categories`,'get',data)

//获取商品分类参数
let getCateParams = (id:number,data:CateParamsSelType)=>http(`categories/${id}/attributes`,'get',data)

// 添加商品
let addGoods = (data:AddGoodsParams)=>http(`goods`,'post',data);

//编辑提交参数
let updateParams = (id:number,attrId:number,data:ParmasUpdateType)=> http(`categories/${id}/attributes/${attrId}`,'put',data)

// 获取数据报表
let getDataReports = ()=>http(`reports/type/1`,'get')
export {
    getGoodsList,
    getCateList,
    getCateParams,
    addGoods,
    updateParams,
    getDataReports
}